package com.example.winner.autocompletetextview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.MultiAutoCompleteTextView;

public class MainActivity extends AppCompatActivity {
    private static final String[] autoStr = new String[] { "Italy","IT","item","its","itself","abc","abcd","abcde"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, autoStr);
        AutoCompleteTextView myACT = (AutoCompleteTextView) findViewById(R.id.myACT);
        myACT.setAdapter(adapter);
        MultiAutoCompleteTextView myMACT = (MultiAutoCompleteTextView) findViewById(R.id.myMACT);
        myMACT.setAdapter(adapter);
        myMACT.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
    }
}
